
import { gameConfigHandle } from 'core/config/gameConfig'

import { BagModel } from './bagModel'
import { BaseInfoModel } from './baseInfoModel'
import { ItemInfoModel } from './itemInfoModel'
import { TeamModel } from './teamModel'
import { AdventureModel } from './adventureModel'
import { MarketModel } from './marketModel'
import { TalentModel } from './talentModel'
import { TreasureModel } from './treasureModel'
import { ResearchModel } from './researchModel'
import { TaskModel } from './taskModel'
import { ItemModel } from './itemModel'
import { MagicMachineModel } from './magicMachineModel'
import { AltarModel } from './altarModel'
import { TeamEquipmentModel } from './teamEquipmentsModel'
import { ChestDataModel } from './chestDataModel'
import { FormationModel } from './formationModel'
import { HalidomModel } from './halidomModel'
import { LuckModel } from './luckModel'
import { GodModel } from './godModel'

export class AltarPetsModel {
    altarLvl: number
    altarAddAmount: number
    petsInAltar: ItemModel[]
    constructor(opts: any = {}) {
        this.altarLvl = opts.altarLvl || 0
        this.altarAddAmount = opts.altarAddAmount || 0
        this.petsInAltar = opts.petsInAltar || [null, null, null, null, null, null, null, null, null, null, null, null]
    }
}
export class FriendshipModel {
    friendshipLvls: any//friendHeroId:lvl
    friendshipSkills: any //friendHeroId:index
    disciples: any//传承弟子 //friendHeroId:heroId
    attris: any//普通属性2条 friendHeroId:[attriName,]
    subAttris: any//百分比属性1条 friendHeroId:[attriName,]
    constructor(opts: any = {}) {
        this.friendshipLvls = opts.friendshipLvls || {}
        this.friendshipSkills = opts.friendshipSkills || {}
        this.disciples = opts.disciples || {}
        this.attris = opts.attris || {}
        this.subAttris = opts.subAttris || {}
    }
}
export class SpiritModel {
    changeItems: number[]
    spiritLvls: any
    refreshTimes: number
    totalLvlAttris:any
    constructor(opts: any = {}) {
        this.changeItems = opts.changeItems || []
        this.spiritLvls = opts.spiritLvls || {}
        this.refreshTimes = opts.refreshTimes || 0
        this.totalLvlAttris = opts.totalLvlAttris || {}
    }
}

export class ChModel {
    c1: number
    c2: number
    mD: any
    constructor(opts: any = {}) {
       this.c1 = opts.c1 || 0
       this.c2 = opts.c2 || 0
       this.mD = opts.mD || {}
    }
}

export class PlayerModel {
    id: string
    baseInfo: BaseInfoModel
    itemInfo: ItemInfoModel
    useInfo: ItemInfoModel
    adventure: AdventureModel
    teamEquipment: TeamEquipmentModel
    rMapTime: any
    team: TeamModel
    bag: BagModel
    petBag: BagModel
    halidomBag: BagModel
    equipmentBag: BagModel
    skillBag: BagModel
    market: MarketModel
    talent: TalentModel
    treasure: TreasureModel
    lskillLvls: any
    skillLvls: any
    research: ResearchModel
    task: TaskModel
    altarPets: AltarPetsModel
    gemTeamLvl: number//宝石共鸣等级
    magicMachine: MagicMachineModel
    chestData: ChestDataModel
    altar: AltarModel
    formation: FormationModel
    halidom: HalidomModel
    luck: LuckModel
    god: GodModel
    packageAttributesLvls: any//套装词缀等级
    friendship: FriendshipModel
    ch: ChModel
    spirit: SpiritModel
    constructor(opts: any = {}) {
        this.id = opts.id || ''
        this.baseInfo = new BaseInfoModel(opts.baseInfo)
        this.itemInfo = new ItemInfoModel(opts.itemInfo)
        this.useInfo = opts.useInfo || {}
        this.adventure = new AdventureModel(opts.adventure)
        this.rMapTime = opts.rMapTime || {}
        this.bag = new BagModel(opts.bag)
        // this.skillBag = new BagModel(opts.skillBag)
        this.equipmentBag = new BagModel(opts.equipmentBag)
        this.petBag = new BagModel(opts.petBag)
        this.team = new TeamModel(opts.team)
        this.market = new MarketModel(opts.market)
        this.talent = new TalentModel(opts.talent)
        this.treasure = new TreasureModel(opts.treasure)
        this.lskillLvls = opts.lskillLvls || {}
        this.skillLvls = opts.skillLvls || {}
        this.research = new ResearchModel(opts.research)
        this.task = new TaskModel(opts.task)
        this.altarPets = new AltarPetsModel(opts.altarPets)
        this.gemTeamLvl = opts.gemTeamLvl || 0
        // this.magicMachine = new MagicMachineModel(opts.magicMachine)
        this.altar = new AltarModel(opts.altar)
        this.teamEquipment = new TeamEquipmentModel(opts.teamEquipment)
        this.chestData = new ChestDataModel(opts.chestData)
        this.formation = new FormationModel(opts.formation)
        this.halidom = new HalidomModel(opts.halidom)
        this.halidomBag = new BagModel(opts.halidomBag)
        this.luck = new LuckModel(opts.luck)
        this.god = new GodModel(opts.god)
        this.packageAttributesLvls = opts.packageAttributesLvls || {}
        this.friendship = new FriendshipModel(opts.friendship)
        this.ch = new ChModel(opts.ch)
        this.spirit = new SpiritModel(opts.spirit)
    }
}

